using System;
using System.Collections;
using System.Collections.Generic;

namespace Live2D.Cubism.Core.Unmanaged
{
	public class ListUnsafe<T> : IList<T>
	{
		private int mCount;                      //
		public readonly T[] Items;                                                      //

		public ListUnsafe(int capacity)
		{
			Items = new T[capacity];
			mCount = 0;
		}
		public bool HasItem
		{
			get { return mCount > 0; }
		}
		#region Implementation of IEnumerable

		public IEnumerator<T> GetEnumerator()
		{
			throw new NotImplementedException();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}

		#endregion

		#region Implementation of ICollection<T>

		public void Add(T item)
		{
			Items[mCount] = item;
			mCount++;
		}
		public void Clear()
		{
			mCount = 0;
		}

		public bool Contains(T item)
		{
			throw new NotImplementedException();
		}

		public void CopyTo(T[] array, int arrayIndex)
		{
			throw new NotImplementedException();
		}

		public bool Remove(T item)
		{
			throw new NotImplementedException();
		}

		public int Count
		{
			get { return mCount; }
		}

		public bool IsReadOnly
		{
			get
			{
				return false;
			}
		}

		#endregion

		#region Implementation of IList<T>

		public int IndexOf(T item)
		{
			throw new NotImplementedException();
		}

		public void Insert(int index, T item)
		{
			throw new NotImplementedException();
		}

		public void RemoveAt(int index)
		{
			throw new NotImplementedException();
		}

		public T this[int index]
		{
			get { throw new NotImplementedException(); }
			set { throw new NotImplementedException(); }
		}

		#endregion
	}
}